package cn.wolfcode.crud.mapper;

import cn.wolfcode.crud.domain.Employee;
import cn.wolfcode.crud.qo.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Employee record);

    Employee selectByPrimaryKey(Long id);

    List<Employee> selectAll();

    int updateByPrimaryKey(Employee record);


    List<Employee> selectForList(QueryObject qo);

    void insertRelation(@Param("eid") Long eid, @Param("rid") Long rid);

    void insertRelation2(@Param("eid") Long eid, @Param("ids") Long[] ids);

    void deleteRelation(Long eid);

    Employee selectByUserNameAndPassword(@Param("username") String username, @Param("password") String password);

    Employee selectByPassword(@Param("id") Long id, @Param("oldPassword") String oldPassword);

    void updateByPassword(@Param("id") Long id, @Param("newPassword") String newPassword);

    void batchDelete(Long[] ids);


    Employee selectByName(String name);


    List<Employee> selectByRolesn(String[] sns);
}